package cu.tedu.io;
//复制文件
import java.io.*;
import java.sql.SQLOutput;
import java.util.BitSet;
import java.util.Scanner;

public class Text3<b> {
    public static void main(String[] args) throws IOException {
        String from = new Scanner(System.in).nextLine();//读
        String to = new Scanner(System.in).nextLine();//写

        copyOf(from, to);
        System.out.println("文件复制完成...");
    }

    public static void copyOf(String from, String to) throws IOException {

        InputStream in = new BufferedInputStream(new FileInputStream(from));

        OutputStream out = new BufferedOutputStream(new FileOutputStream(to));

        int b = 0;
        long start = System.currentTimeMillis();//记时开始ms
        while ((b = in.read()) != -1) {
            out.write(b);

        }
        byte[] buf =new byte[8192];
        while ((b=in.read(buf))!=-1){
            out.write(buf);

        long end = System.currentTimeMillis();//计时结束
        System.out.println(b);
        in.close();
        out.close();


        }



    }
}
